home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1470 / 3dtext.frm (.txt) < prev    next >
Visual Basic Form  |  1996-06-08  |  14KB  |  453 lines

  1. VERSION 4.00
  2. Begin VB.Form frm3DText 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "VBMax 3D Effects Demo - Text"
  5.    ClientHeight    =   4755
  6.    ClientLeft      =   510
  7.    ClientTop       =   1140
  8.    ClientWidth     =   8535
  9.    Height          =   5160
  10.    Icon            =   "3DText.frx":0000
  11.    Left            =   450
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4755
  17.    ScaleWidth      =   8535
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   795
  20.    Width           =   8655
  21.    Begin VB.Frame Frame4 
  22.       Caption         =   "Effect"
  23.       Height          =   3135
  24.       Left            =   4740
  25.       TabIndex        =   32
  26.       Top             =   1500
  27.       Width           =   2235
  28.       Begin VB.OptionButton optEffect 
  29.          Caption         =   "Projected"
  30.          Height          =   255
  31.          Index           =   8
  32.          Left            =   180
  33.          TabIndex        =   22
  34.          Top             =   2760
  35.          Width           =   1155
  36.       End
  37.       Begin VB.OptionButton optEffect 
  38.          Caption         =   "Outline Left"
  39.          Height          =   255
  40.          Index           =   7
  41.          Left            =   180
  42.          TabIndex        =   21
  43.          Top             =   2460
  44.          Width           =   1275
  45.       End
  46.       Begin VB.OptionButton optEffect 
  47.          Caption         =   "Outline Right"
  48.          Height          =   255
  49.          Index           =   6
  50.          Left            =   180
  51.          TabIndex        =   20
  52.          Top             =   2160
  53.          Width           =   1335
  54.       End
  55.       Begin VB.OptionButton optEffect 
  56.          Caption         =   "Floating"
  57.          Height          =   255
  58.          Index           =   5
  59.          Left            =   180
  60.          TabIndex        =   19
  61.          Top             =   1860
  62.          Width           =   915
  63.       End
  64.       Begin VB.OptionButton optEffect 
  65.          Caption         =   "Embossed Recessed"
  66.          Height          =   255
  67.          Index           =   4
  68.          Left            =   180
  69.          TabIndex        =   18
  70.          Top             =   1560
  71.          Width           =   1995
  72.       End
  73.       Begin VB.OptionButton optEffect 
  74.          Caption         =   "Embossed Raised"
  75.          Height          =   255
  76.          Index           =   3
  77.          Left            =   180
  78.          TabIndex        =   17
  79.          Top             =   1260
  80.          Width           =   1695
  81.       End
  82.       Begin VB.OptionButton optEffect 
  83.          Caption         =   "Recessed"
  84.          Height          =   255
  85.          Index           =   2
  86.          Left            =   180
  87.          TabIndex        =   16
  88.          Top             =   960
  89.          Width           =   1155
  90.       End
  91.       Begin VB.OptionButton optEffect 
  92.          Caption         =   "Raised"
  93.          Height          =   255
  94.          Index           =   1
  95.          Left            =   180
  96.          TabIndex        =   15
  97.          Top             =   660
  98.          Value           =   -1  'True
  99.          Width           =   915
  100.       End
  101.       Begin VB.OptionButton optEffect 
  102.          Caption         =   "Normal"
  103.          Height          =   255
  104.          Index           =   0
  105.          Left            =   180
  106.          TabIndex        =   14
  107.          Top             =   360
  108.          Width           =   915
  109.       End
  110.    End
  111.    Begin VB.Frame Frame3 
  112.       Caption         =   "Shadow"
  113.       Height          =   1215
  114.       Left            =   7140
  115.       TabIndex        =   31
  116.       Top             =   1500
  117.       Width           =   1275
  118.       Begin VB.OptionButton optShadow 
  119.          Caption         =   "Dark"
  120.          Height          =   255
  121.          Index           =   1
  122.          Left            =   240
  123.          TabIndex        =   24
  124.          Top             =   720
  125.          Width           =   795
  126.       End
  127.       Begin VB.OptionButton optShadow 
  128.          Caption         =   "Light"
  129.          Height          =   255
  130.          Index           =   0
  131.          Left            =   240
  132.          TabIndex        =   23
  133.          Top             =   360
  134.          Value           =   -1  'True
  135.          Width           =   795
  136.       End
  137.    End
  138.    Begin VB.Frame Frame2 
  139.       Caption         =   "Font"
  140.       Height          =   3135
  141.       Left            =   1680
  142.       TabIndex        =   28
  143.       Top             =   1500
  144.       Width           =   2895
  145.       Begin VB.CommandButton Command1 
  146.          Caption         =   "Font Dialog"
  147.          Height          =   315
  148.          Left            =   1380
  149.          TabIndex        =   34
  150.          Top             =   2700
  151.          Width           =   1155
  152.       End
  153.       Begin VB.ComboBox cboFontNames 
  154.          Height          =   315
  155.          Left            =   180
  156.          Sorted          =   -1  'True
  157.          Style           =   2  'Dropdown List
  158.          TabIndex        =   8
  159.          Top             =   540
  160.          Width           =   2535
  161.       End
  162.       Begin VB.ComboBox cboTextSize 
  163.          Height          =   1740
  164.          Left            =   180
  165.          Style           =   1  'Simple Combo
  166.          TabIndex        =   9
  167.          Top             =   1260
  168.          Width           =   915
  169.       End
  170.       Begin VB.CheckBox chkBold 
  171.          Caption         =   "Bold"
  172.          Height          =   315
  173.          Left            =   1380
  174.          TabIndex        =   10
  175.          Top             =   1200
  176.          Width           =   795
  177.       End
  178.       Begin VB.CheckBox chkItalic 
  179.          Caption         =   "Italic"
  180.          Height          =   315
  181.          Left            =   1380
  182.          TabIndex        =   11
  183.          Top             =   1560
  184.          Width           =   795
  185.       End
  186.       Begin VB.CheckBox chkUnderline 
  187.          Caption         =   "Underline"
  188.          Height          =   315
  189.          Left            =   1380
  190.          TabIndex        =   12
  191.          Top             =   1920
  192.          Width           =   1095
  193.       End
  194.       Begin VB.CheckBox chkStrikeout 
  195.          Caption         =   "Strikeout"
  196.          Height          =   315
  197.          Left            =   1380
  198.          TabIndex        =   13
  199.          Top             =   2280
  200.          Width           =   1095
  201.       End
  202.       Begin VB.Label Label2 
  203.          AutoSize        =   -1  'True
  204.          Caption         =   "Name:"
  205.          Height          =   195
  206.          Left            =   180
  207.          TabIndex        =   30
  208.          Top             =   300
  209.          Width           =   465
  210.       End
  211.       Begin VB.Label Label3 
  212.          AutoSize        =   -1  'True
  213.          Caption         =   "Size:"
  214.          Height          =   195
  215.          Left            =   180
  216.          TabIndex        =   29
  217.          Top             =   1020
  218.          Width           =   345
  219.       End
  220.    End
  221.    Begin VB.Frame Frame1 
  222.       Caption         =   "Color"
  223.       Height          =   3135
  224.       Left            =   120
  225.       TabIndex        =   27
  226.       Top             =   1500
  227.       Width           =   1395
  228.       Begin VB.CommandButton cmdSelect 
  229.          Caption         =   "Color Dialog"
  230.          Height          =   315
  231.          Left            =   120
  232.          TabIndex        =   33
  233.          Top             =   2760
  234.          Width           =   1155
  235.       End
  236.       Begin VB.OptionButton optColor 
  237.          Caption         =   "White"
  238.          ForeColor       =   &H00FFFFFF&
  239.          Height          =   255
  240.          Index           =   8
  241.          Left            =   180
  242.          TabIndex        =   7
  243.          Top             =   2460
  244.          Width           =   1095
  245.       End
  246.       Begin VB.OptionButton optColor 
  247.          Caption         =   "Cyan"
  248.          ForeColor       =   &H00FFFF00&
  249.          Height          =   255
  250.          Index           =   7
  251.          Left            =   180
  252.          TabIndex        =   6
  253.          Top             =   2160
  254.          Width           =   1095
  255.       End
  256.       Begin VB.OptionButton optColor 
  257.          Caption         =   "Magenta"
  258.          ForeColor       =   &H00FF00FF&
  259.          Height          =   255
  260.          Index           =   6
  261.          Left            =   180
  262.          TabIndex        =   5
  263.          Top             =   1860
  264.          Width           =   1095
  265.       End
  266.       Begin VB.OptionButton optColor 
  267.          Caption         =   "Blue"
  268.          ForeColor       =   &H00FF0000&
  269.          Height          =   255
  270.          Index           =   5
  271.          Left            =   180
  272.          TabIndex        =   4
  273.          Top             =   1560
  274.          Value           =   -1  'True
  275.          Width           =   1095
  276.       End
  277.       Begin VB.OptionButton optColor 
  278.          Caption         =   "Yellow"
  279.          ForeColor       =   &H0000FFFF&
  280.          Height          =   255
  281.          Index           =   4
  282.          Left            =   180
  283.          TabIndex        =   3
  284.          Top             =   1260
  285.          Width           =   1095
  286.       End
  287.       Begin VB.OptionButton optColor 
  288.          Caption         =   "Green"
  289.          ForeColor       =   &H0000FF00&
  290.          Height          =   255
  291.          Index           =   3
  292.          Left            =   180
  293.          TabIndex        =   2
  294.          Top             =   960
  295.          Width           =   1095
  296.       End
  297.       Begin VB.OptionButton optColor 
  298.          Caption         =   "Red"
  299.          ForeColor       =   &H000000FF&
  300.          Height          =   255
  301.          Index           =   2
  302.          Left            =   180
  303.          TabIndex        =   1
  304.          Top             =   660
  305.          Width           =   1095
  306.       End
  307.       Begin VB.OptionButton optColor 
  308.          Caption         =   "Black"
  309.          ForeColor       =   &H00000000&
  310.          Height          =   255
  311.          Index           =   1
  312.          Left            =   180
  313.          TabIndex        =   0
  314.          Top             =   360
  315.          Width           =   1095
  316.       End
  317.    End
  318.    Begin VB.CommandButton cmdClose 
  319.       Cancel          =   -1  'True
  320.       Caption         =   "Close"
  321.       Height          =   360
  322.       Left            =   7380
  323.       TabIndex        =   25
  324.       Top             =   4260
  325.       Width           =   900
  326.    End
  327.    Begin VB.Label Label1 
  328.       Alignment       =   2  'Center
  329.       BackStyle       =   0  'Transparent
  330.       Caption         =   "VBMax 3D Text Effects"
  331.       BeginProperty Font 
  332.          name            =   "MS Sans Serif"
  333.          charset         =   0
  334.          weight          =   400
  335.          size            =   18
  336.          underline       =   0   'False
  337.          italic          =   0   'False
  338.          strikethrough   =   0   'False
  339.       EndProperty
  340.       ForeColor       =   &H00C00000&
  341.       Height          =   435
  342.       Left            =   720
  343.       TabIndex        =   26
  344.       Top             =   240
  345.       Width           =   3975
  346.    End
  347. Attribute VB_Name = "frm3DText"
  348. Attribute VB_Creatable = False
  349. Attribute VB_Exposed = False
  350. Option Explicit
  351. Dim mo3D   As New C3D
  352. Private Sub Form_Load()
  353. Dim i As Integer
  354.     CenterForm Me
  355.     With cboFontNames
  356.         For i = 0 To Screen.FontCount - 1
  357.             .AddItem Screen.Fonts(i)
  358.         Next i
  359.     End With
  360.     With cboTextSize
  361.         .AddItem "8"
  362.         .AddItem "10"
  363.         .AddItem "12"
  364.         .AddItem "14"
  365.         .AddItem "20"
  366.         .AddItem "24"
  367.         .AddItem "26"
  368.         .AddItem "32"
  369.     End With
  370.     With mo3D
  371.         .Style = gnRAISED
  372.         .Caption Label1, gnUSE_CONTROL_FONT
  373.     End With
  374. End Sub
  375. Private Sub Form_Unload(Cancel As Integer)
  376.     Set mo3D = Nothing
  377.     Set frm3DText = Nothing
  378. End Sub
  379. Private Sub cmdClose_Click()
  380.     Unload Me
  381. End Sub
  382. Sub RedrawText()
  383.     Cls
  384.     mo3D.Caption Label1
  385. End Sub
  386. Private Sub optColor_Click(Index As Integer)
  387.     mo3D.ForeColor = optColor(Index).ForeColor
  388.     RedrawText
  389. End Sub
  390. Private Sub cboFontNames_Click()
  391.     mo3D.FontName = cboFontNames.Text
  392.     RedrawText
  393. End Sub
  394. Private Sub cboTextSize_Click()
  395.     mo3D.FontSize = cboTextSize.Text
  396.     RedrawText
  397. End Sub
  398. Private Sub cboTextSize_Change()
  399.     mo3D.FontSize = Val(cboTextSize.Text)
  400.     RedrawText
  401. End Sub
  402. Private Sub chkBold_Click()
  403.     If chkBold.Value = vbChecked Then
  404.         mo3D.FontBold = True
  405.     Else
  406.         mo3D.FontBold = False
  407.     End If
  408.     RedrawText
  409. End Sub
  410. Private Sub chkItalic_Click()
  411.     If chkItalic.Value = vbChecked Then
  412.         mo3D.FontItalic = True
  413.     Else
  414.         mo3D.FontItalic = False
  415.     End If
  416.     RedrawText
  417. End Sub
  418. Private Sub chkStrikeout_Click()
  419.     If chkStrikeout.Value = vbChecked Then
  420.         mo3D.FontStrikethru = True
  421.     Else
  422.         mo3D.FontStrikethru = False
  423.     End If
  424.     RedrawText
  425. End Sub
  426. Private Sub chkUnderline_Click()
  427.     If chkUnderline.Value = vbChecked Then
  428.         mo3D.FontUnderline = True
  429.     Else
  430.         mo3D.FontUnderline = False
  431.     End If
  432.     RedrawText
  433. End Sub
  434. Private Sub optEffect_Click(Index As Integer)
  435.     mo3D.Style = Index
  436.     RedrawText
  437. End Sub
  438. Private Sub optShadow_Click(Index As Integer)
  439.     Select Case Index
  440.         Case 0: mo3D.Shadow = gnLIGHT_SHADOW
  441.         Case 1: mo3D.Shadow = gnDARK_SHADOW
  442.     End Select
  443.     RedrawText
  444. End Sub
  445. Private Sub cmdSelect_Click()
  446.     mo3D.SelectForeColor
  447.     RedrawText
  448. End Sub
  449. Private Sub Command1_Click()
  450.     mo3D.SelectFont
  451.     RedrawText
  452. End Sub
  453.